#ifndef CPP_MESSAGE_H
#define CPP_MESSAGE_H
#include <utils/Pool.hpp>

class Handler;

//@brief 消息
//@author cvte
class Message {
   public:
    /* data */
    const static int MAX_POOL_SIZE = 50;
    Message(/* args */);
    ~Message();

    int what = 0;
    int arg1 = 0;
    int arg2 = 0;
    long obj = 0;
    Handler* target = nullptr;

    static Message& obtain(Handler& handler);
    void recycleUnchecked();

   private:
    static Pool<Message>* sMessagePool;
};

#endif /* CPP_MESSAGE_H */